package com.sixj.keycloakssointegration.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author sixiaojie
 * @date 2025-07-15-10:24
 */
@Configuration
public class CorsConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/api/**")
                .allowedOrigins("*")    // 实际部署时请指定域名
                .allowedMethods("*")
                .allowedHeaders("*")
                .allowCredentials(false);
    }
}